<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> 
<head>
<%@ include file="../../include/easyui.jsp" %>
<%@ include file="../../include/pForm.jsp" %>
<%@ include file="/WEB-INF/jsp/include/easyui-layui-upload.jsp" %>
<title>借支申请</title>
<style type="text/css"> .textbox-label { width: 85px; }</style>
<script>
	$(function(){
		layui.use(['util'], function(){
			var util = layui.util;
			var date = util.toDateString(new Date().getTime(), 'yyyy-MM-dd')
			$("input[name=noteDate]").val(date);
		});
		$.getJSON('/console/JZD/autoCode', {} ,function(res){
			if(res.flag){
				$("input[name=noteNo]").val(res.data.code);
			}
		});
		
		$("input[name=money]").bind("input propertychange",function(event){
		       var money = $(this).val();
		       money = $.RMB(money);
		       $("#bigWrite").text(money);
		});
		
		function closeThisWin(){
			var pp = parent.parent.$('#easyui-tabs').tabs('getSelected');   
			var index = parent.parent.$('#easyui-tabs').tabs('getTabIndex',pp);
			parent.parent.$('#easyui-tabs').tabs('close',index);
		}
		
		$('#easyuiForm').form({ 
		    onSubmit: function(){  
		    	return $(this).form('enableValidation').form('validate');
		    },    
		    success:function(data){
		    	var json = JSON.parse(data);
				if(json && json.flag){
					parent.$.messager.show({
						title:'我的消息',
						msg:'借支申请提交成功！',
						timeout:5000,
						showType:'slide'
					});
				}
				closeThisWin();
		    }    
		});    

		
		$(".easyui-linkbutton").on("click",function(){
			var id = $(this).attr("id");
			if(id=='save'){
				$('#easyuiForm').submit();  
			}else{
				closeThisWin();
			}
		});
	});
</script>
</head>
<body class="easyui-layout">
    <div data-options="region:'south',split:true" style="height:50px;">
    	<div style="height: 40px;line-height: 40px;text-align: center;">
	    	<a id="save" href="#" class="easyui-linkbutton" style="width: 80px;" data-options="iconCls:'icon-edit'">保存</a>  
	    	<a id="close" href="#" class="easyui-linkbutton" style="width: 80px;" data-options="iconCls:'icon-no'">关闭</a>  
    	</div>
    </div>   
    <div data-options="region:'center'" style="padding:5px;text-align: center;">
		<!-- 替换自动form表单 -->
		<form id="easyuiForm" method="post" action="/console/activiti/startOrSubmit" style="padding: 5px;"   >
		 <!--类名属性及默认主键id-->
		 <input type="hidden" name="className" value="com.fs.jzzn.pojo.NoteDebit" />
		 <input type="hidden" name="id" value="" />
		 <input type="hidden" name="createrId" value="${SESSION_USER.user.id}" />
		 <table cellspacing="0" cellpadding="0" data-sort="sortDisabled">
				<tbody>
					<tr style=";height:38px" class="firstRow">
						<td width="103" rowspan="3" valign="top" style="border: 1px solid windowtext; padding: 0px 7px;"
							height="38">
							<p style="text-align:center">
								<span style="font-size:12px;font-family:宋体">
									<!--
									<img style="width:118px;height:118px" src="/images/logo_jz.jpg" alt="公司图标1" />
									 -->
								</span>
							</p>
						</td>
						<td width="371" colspan="3" rowspan="2"
							style="border-top: 1px solid windowtext; border-left: none; border-bottom: 1px dotted windowtext; border-right: 1px solid windowtext; padding: 0px 7px;"
							height="38">
							<p style="text-align:center">
								<strong><span style="font-size:24px;font-family:宋体">借&nbsp;
										支&nbsp; 申&nbsp; 请&nbsp; 单</span></strong>
							</p>
						</td>
						<td width="73" valign=""
							style="border-top: 1px solid windowtext; border-right: 1px solid windowtext; border-bottom: 1px solid windowtext; border-image: initial; border-left: none; padding: 0px 7px;"
							height="38">
							<p style="text-align:center">
								<span style="font-size:12px;font-family:宋体">单据编号</span>
							</p>
						</td>
						<td width="117" valign="bottom"
							style="border-top: 1px solid windowtext; border-right: 1px solid windowtext; border-bottom: 1px solid windowtext; border-image: initial; border-left: none; padding: 0px 7px;"
							height="38">
								<input name="noteNo" type="text" style="border: 0;width: 100%;height: 100%;" readonly="readonly" />
							</td>
					</tr>
					<tr style=";height:30px">
						<td width="73" valign=""
							style="border-top: none; border-left: none; border-bottom: 1px solid windowtext; border-right: 1px solid windowtext; padding: 0px 7px;"
							height="30">
							<p style="text-align:center">
								<span style="font-size:12px;font-family:宋体">部&nbsp;&nbsp;门</span>
							</p>
						</td>
						<td width="97"
							style="border-top: none; border-left: none; border-bottom: 1px solid windowtext; border-right: 1px solid windowtext; padding:7px;"
							height="30">
							<input type="hidden" name="orgNo" value="${SESSION_USER.user.orgNo}" />
							<input type="text" name="orgNoName" readonly="readonly" style="border: 0;" value="${SESSION_USER.user.orgNoName}" />
						</td>
					</tr>
					<tr style=";height:21px">
						<td width="371" colspan="3"
							style="border-top: none; border-left: none; border-bottom: 1px solid windowtext; border-right: 1px solid windowtext; padding: 0px 7px;"
							height="21">
							<p style="text-align:center">
								<span style="font-size:12px;font-family:宋体">申请日期：&nbsp;&nbsp;&nbsp;
									<input name="noteDate" style="width: 180px;border: 0;" readonly="readonly"/>
								</span>
							</p>
						</td>
						<td width="73" valign=""
							style="border-top: none; border-left: none; border-bottom: 1px solid windowtext; border-right: 1px solid windowtext; padding: 0px 7px;"
							height="21">
							<p style="text-align:center">
								<span style="font-size:12px;font-family:宋体">请 款 人</span>
							</p>
						</td>
						<td width="117" valign="bottom"
							style="border-top: none; border-left: none; border-bottom: 1px solid windowtext; border-right: 1px solid windowtext; padding: 0px 7px;"
							height="21">${SESSION_USER.user.nickName}</td>
					</tr>
					<tr style=";height:40px">
						<td width="103"
							style="border-right: 1px solid windowtext; border-bottom: 1px solid windowtext; border-left: 1px solid windowtext; border-image: initial; border-top: none; padding: 0px 7px;"
							height="40">
							<p style="text-align:center">
								<span style="font-size:12px;font-family:宋体">借支金额</span>
							</p>
						</td>
						<td width="561" colspan="5"
							style="border-top: none; border-left: none; border-bottom: 1px solid windowtext; border-right: 1px solid windowtext; padding: 0px 7px; word-break: break-all;"
							height="40">
							<p style="text-align:left">
								<span style="font-size:   12px;font-family:宋体">人民币(大写)：
								<span id="bigWrite" style="font-family: 宋体; font-size: 12px;"></span>
								<span style="float: right;margin-right: 100px;">￥&nbsp;
									<input class="easyui-validatebox" data-options="required:true,validType:'decimals[2]'" name="money" style="width: 150px;height: 30px;line-height: 30px;border-left: 0;border-right: 0;border-top: 0;border-color: black;"/></span>
								</span>
							</p>
						</td>
					</tr>
					<tr style=";height:40px">
						<td width="103"
							style="border-right: 1px solid windowtext; border-bottom: 1px solid windowtext; border-left: 1px solid windowtext; border-image: initial; border-top: none; padding: 0px 7px;"
							height="40">
							<p style="text-align:center">
								<span style="font-size:12px;font-family:宋体">开 户 行</span>
							</p>
						</td>
						<td width="234"
							style="border-top: none; border-left: none; border-bottom: 1px solid windowtext; border-right: 1px solid windowtext; padding: 0px 7px;"
							height="40">
								<input name="bank" style="width:100%;height: 100%;border: 0;" />
							</td>
						<td width="80"
							style="border-top: none; border-left: none; border-bottom: 1px solid windowtext; border-right: 1px solid windowtext; padding: 0px 7px;"
							height="40">
							<p style="text-align:center">
								<span style="font-size:12px;font-family:宋体">银行账号</span>
							</p>
						</td>
						<td width="241" colspan="3"
							style="border-top: none; border-left: none; border-bottom: 1px solid windowtext; border-right: 1px solid windowtext; padding: 0px 7px;"
							height="40">
							<input name="bankAccount" style="width:100%;height: 100%;border: 0;" />
							</td>
					</tr>
					<tr style=";height:40px">
						<td width="103"
							style="border-right: 1px solid windowtext; border-bottom: 1px solid windowtext; border-left: 1px solid windowtext; border-image: initial; border-top: none; padding: 0px 7px;"
							height="40">
							<p style="text-align:center">
								<span style="font-size:12px;font-family:宋体">付款方式</span>
							</p>
						</td>
						<td width="561" colspan="5"
							style="border-top: none; border-left: none; border-bottom: 1px solid windowtext; border-right: 1px solid windowtext; padding: 0px 7px;"
							height="40">
							<p style="text-align:left">
								<span style="font-family:   宋体">
								    ①现金<input type="radio" name="payType" value="现金" checked="checked" />&nbsp;&nbsp;&nbsp;
									②网银转账<input type="radio" name="payType" value="网银转账" /></span>
							</p>
						</td>
					</tr>
					<tr style=";height:82px">
						<td width="103"
							style="border-right: 1px solid windowtext; border-bottom: 1px solid windowtext; border-left: 1px solid windowtext; border-image: initial; border-top: none; padding: 0px 7px; word-break: break-all;"
							height="82">
							<p style="text-align:center;line-height:150%">
								<span style="font-size:12px;line-height:150%;font-family:宋体">借支事由</span>
							</p>
						</td>
						<td width="561" colspan="5" valign="top"
							style="border-top: none; border-left: none; border-bottom: 1px solid windowtext; border-right: 1px solid windowtext; padding: 0px 7px;"
							height="82">
								<textarea  class="easyui-validatebox"  name="remark" data-options="required:true,validType:'maxLen[10]'" style="width:100%;height: 100%;border: 0" ></textarea>
							</td>
					</tr>
					<tr style=";height:40px">
						<td width="103"
							style="border-right: 1px solid windowtext; border-bottom: 1px solid windowtext; border-left: 1px solid windowtext; border-image: initial; border-top: none; padding: 0px 7px; word-break: break-all;"
							height="40">
							<p style="text-align:center">
								<span style="font-size:12px;font-family:宋体"></span>
							</p>
							<p
								style="margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: normal; text-align: center;">
								<span style="font-size: 12px; font-family: 宋体;">部&nbsp; 门</span>
							</p>
							<p>
								<span style="font-size: 12px; font-family: 宋体;">&nbsp;
									审核意见</span>
							</p>
							<p style="text-align:center">
								<span style="font-size:12px;font-family:宋体">
								</span><br />
							</p>
						</td>
						<td width="234"
							style="border-top: none; border-left: none; border-bottom: 1px solid windowtext; border-right: 1px solid windowtext; padding: 0px 7px;"
							height="40">
							
							<textarea name="deptDesc" style="width:100%;height: 100%;border: 0" ></textarea>
							</td>
						<td width="80"
							style="border-top: none; border-left: none; border-bottom: 1px solid windowtext; border-right: 1px solid windowtext; padding: 0px 7px; word-break: break-all;"
							height="40">
							<p style="text-align:center">
								<span style="font-size:12px;font-family:宋体"></span>
							</p>
							<p
								style="margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: normal; text-align: center;">
								<span style="font-size: 12px; font-family: 宋体;">片&nbsp;
									&nbsp;区</span>
							</p>
							<p>
								<span style="font-size: 12px; font-family: 宋体;">&nbsp;审核意见</span>
							</p>
							<p style="text-align:center">
								<span style="font-size:12px;font-family:宋体"></span><br />
							</p>
						</td>
						<td width="241" colspan="3"
							style="border-top: none; border-left: none; border-bottom: 1px solid windowtext; border-right: 1px solid windowtext; padding: 0px 7px;"
							height="40">
							<textarea name="areaDesc" style="width:100%;height: 100%;border: 0" ></textarea>
							</td>
					</tr>
					<tr style=";height:40px">
						<td width="103"
							style="border-right: 1px solid windowtext; border-bottom: 1px solid windowtext; border-left: 1px solid windowtext; border-image: initial; border-top: none; padding: 0px 7px; word-break: break-all;"
							height="40">
							<p style="text-align:center">
								<span style="font-size:12px;font-family:宋体"></span>
							</p>
							<p
								style="margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: normal; text-align: center;">
								<span style="font-size: 12px; font-family: 宋体;">财 务 部</span>
							</p>
							<p>
								<span style="font-size: 12px; font-family: 宋体;">&nbsp;
									审核意见</span>
							</p>
							<p style="text-align:center">
								<span style="font-size:12px;font-family:宋体"></span><br />
							</p>
						</td>
						<td width="234"
							style="border-top: none; border-left: none; border-bottom: 1px solid windowtext; border-right: 1px solid windowtext; padding: 0px 7px;"
							height="40">
							<textarea name="financeDescString" style="width:100%;height: 100%;border: 0" ></textarea>
							</td>
						<td width="80"
							style="border-top: none; border-left: none; border-bottom: 1px solid windowtext; border-right: 1px solid windowtext; padding: 0px 7px; word-break: break-all;"
							height="40">
							<p style="text-align:center">
								<span style="font-size:12px;font-family:宋体"><span
									style="font-family: 宋体; font-size: 12px;">总经理/董事长审批</span></span>
							</p>
						</td>
						<td width="241" colspan="3"
							style="border-top: none; border-left: none; border-bottom: 1px solid windowtext; border-right: 1px solid windowtext; padding: 0px 7px;"
							height="40">
							<textarea name="generalManagerDesc" style="width:100%;height: 100%;border: 0" ></textarea>
						</td>
					</tr>
				</tbody>
			</table>
		</form>
    </div>   
</body>
</html>